import {request} from "../utils/request";
import { ObjTy } from "../types/common";

// 分类列表
export function queryClassificationList(data: ObjTy) {
  return request({
    url: "/class/queryClassificationList",
    method: "post",
    data,
  });
}

// 查询所有分类
export function queryAllClassificationList(data: ObjTy) {
  return request({
    url: "/class/queryAllClassificationList",
    method: "post",
    data,
  });
}

// 分类添加
export function classAdd(data: ObjTy) {
  return request({
    url: "/class/add",
    method: "post",
    data,
  });
}

// 分类编辑
export function classEdit(data: ObjTy) {
  return request({
    url: "/class/edit",
    method: "post",
    data,
  });
}

// 分类删除
export function classDel(data: ObjTy) {
  return request({
    url: "/class/del",
    method: "post",
    data,
  });
}

// 分类添加
export function upload(data: ObjTy) {
  return request({
    url: "/api/upload",
    method: "post",
    data,
  });
}

// 分页查询商品信息
export function getProductList(data: ObjTy) {
  return request({
    url: "/product/queryList",
    method: "post",
    data,
  });
}

// 商品添加
export function productAdd(data: ObjTy) {
  return request({
    url: "/product/add",
    method: "post",
    data,
  });
}

// 商品编辑
export function productEdit(data: ObjTy) {
  return request({
    url: "/product/edit",
    method: "post",
    data,
  });
}

// 商品删除
export function productDel(data: ObjTy) {
  return request({
    url: "/product/del",
    method: "post",
    data,
  });
}

// 商品上下架
export function productUpdateStatus(data: ObjTy) {
  return request({
    url: "/product/updateStatus",
    method: "post",
    data,
  });
}

// 热门推荐
export function productUpdateIsHot(data: ObjTy) {
  return request({
    url: "/product/updateIsHot",
    method: "post",
    data,
  });
}
